/**
 * 定义数据维护模块
 */
(function(window, angular, undefined){

	var module = angular.module('water.entity.dataMaintain',['water.common.AJAXService']);
	
	module.service('$dataMaintainService',function($AJAXService){
		
		/**
		 * 获取站点model
		 */
		this.getModel = function(){
			var promise = $AJAXService.post("/DataMaintain/getModel",{});
			return promise;
		}
		
		this.saveModel = function(site){
			var promise = $AJAXService.post("/DataMaintain/saveModel",site);
			return promise;
		}
		
		/**
		 * 下载配置
		 */
		this.downloadConfig = function(siteCode){
			var promise = $AJAXService.post("/DataMaintain/downloadConfig",{"SITE_CODE":siteCode});
			return promise;
		}
		
		/**
		 * 上传配置
		 */
		this.uploadConfig = function(siteCode){
			var promise = $AJAXService.post("/DataMaintain/uploadConfig",{"SITE_CODE":siteCode});
			return promise;
		}

        /**
         * 读取数据日志
         */
        this.readLogData = function(path){
            var promise = $AJAXService.post("/DataMaintain/readLogData",{"PATH":path});
            return promise;
        }
	})
}(window, angular));